<include file="public@header" />
<style>
	.down_item{
		width: 300px;
		display: block;
		padding-left:20px;
		line-height: 30px;
	}
</style>
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:url('product')}">产品库列表</a></li>
			<li class="active"><a href="{:url('product_lists')}">成交库申请列表</a></li>
		</ul>
		<table class="table table-hover table-bordered margin-top-20">
			<thead>
				<tr>
					<th width="50">ID</th>
					<th>企业名称</th>
					<th>类别</th>
					<th>备注</th>
					<th>申请人</th>
					<th>价格</th>
					<th>经营情况</th>
					<th>联系人</th>
					<th>联系人身份</th>
					<th>转让原因</th>
					<th>经营状况</th>
					<th>申请状态</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<foreach name="lists" item="vo">
				<tr>
					<td>{$vo.id}</td>
					<td>{$vo.company}</td>
					<td>
						<switch name="vo.type">
							<case value="1">投资项</case>
							<case value="2">策划案</case>
						</switch>
					</td>
					<td class="remark">{$vo.remark}</td>
					<td>{$vo.user_nickname}</td>
					<td>{$vo.price}</td>
					<td>{$vo.jyqk}</td>
					<td>{$vo.lxr}</td>
					<td>{$vo.lxrsf}</td>
					<td>{$vo.zryy}</td>
					<td>{$vo.jyzk}</td>
					<td>
						<switch name="vo.product_sh">
							<case value="1">申请中</case>
							<case value="2">申请成功</case>
							<!--<case value="3">申请打回</case>-->
						</switch>
					</td>
					<td>
						<if condition="auth_check('follow')">
							<a href='javascript:parent.openIframeLayer("{:url("resource_library/follow",["pid" => $vo["id"]])}","资源跟进记录")'">跟进</a>
						</if>
						<if condition="auth_check('files')">
							<a href='javascript:show({$vo.id});'>查看</a>
						</if>
						<if condition="auth_check('donesq_se')">
							<a href='{:cmf_url("donesq_se",["id" => $vo["id"]])}' class="js-ajax-dialog-btn"
							   data-msg="是否通过该条记录？">审核通过</a>
						</if>
						<if condition="auth_check('donesq_se')">
							<a href='{:cmf_url("donesq_se",["id" => $vo["id"],"type" => 1])}' class="js-ajax-dialog-btn"
							   data-msg="是否解锁该条记录？">解锁</a>
						</if>
					</td>
				</tr>
				</foreach>
			</tbody>
		</table>
		<div class="pagination">{$page}<li><a>共计 {$lists->total()} 条</a></li></div>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
	<script>
        function show(id) {
            $.ajax({
                url:'{:cmf_url("files")}',
                type:'post',
                data:{id:id},
                success:function(data){
                    Wind.css('layer');
                    Wind.use("layer", function () {
                        html='';
                        if(data.data === null) {
                            layer.alert('该数据未上传文件！', {
                                icon: 1,
                                title: '提示',
                                skin: 'layer-ext-moon'
                            })
                            return;
                        }
                        $.each(data.data,function(key,item){
                            html += '<a class="down_item" href="'+item.url+'">'+item.name+'</a>';
                        })

                        if(html === '') {
                            layer.alert('该数据未上传文件！', {
                                icon: 1,
                                title: '提示',
                                skin: 'layer-ext-moon'
                            })
                        }else{
                            layer.open({
                                type: 1,
                                skin: 'layui-layer-demo', //样式类名
                                closeBtn: 0, //不显示关闭按钮
                                anim: 2,
                                shadeClose: true, //开启遮罩关闭
                                title:'文件查看',
                                content: html
                            });
                        }
                    });
                }
            })
        }
	</script>
</body>
</html>